<?php 
	include 'dbmanager.php';
	$base = new BazaDanych();
	//$base->initDB();
	
	require_once 'function.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Calendar</title>
<link rel="Stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" language="JavaScript" src="scripts.js"></script>
</head>
<body>
<table>
	<tr>
		<th colspan="2" class="top"><h1><a class="white" href="?">Niesamowity CalendarApp w DivingCenter</a></h1></th>
	</tr>
	<tr>
		<td class="menu"><?php include 'menu.php';?></td>
		<td class="main">
			<?php

				if(isset($_GET["s"]) && $_GET["s"]=="login"){
					include 'login.php';
				}else if(isset($_COOKIE["Login"]) && isset($_GET["s"]) && $_GET["s"]=="logout"){
					unset($_COOKIE["Login"]);
					setcookie("Login", null, -1);
					header("Refresh: 0; url=index.php");
				}else if(isset($_COOKIE["Login"]) && isset($_GET["s"]) && $_GET["s"]=="calendar"){
					echo "<div id=\"calendar\">";
					include 'calendar.php';
					echo "</div>";
				}else if(isset($_COOKIE["Login"]) && isset($_GET["s"]) && $_GET["s"]=="events"){
					include 'events.php';
				}else{
					include 'start.php';
				}
			
			?>
		</td>
	</tr>
</table>

<?php include 'footer.php';?>

</body>
</html>